Manages the samplers available in the component.
More...
Manages the samplers available in the component.
The manager owns all memory returned. External code should never delete it.
◆ ~SamplerManager()
nkGraphics::SamplerManager::~SamplerManager |
( |
| ) |
|
◆ createOrRetrieve()
Sampler* nkGraphics::SamplerManager::createOrRetrieve |
( |
const std::string_view & |
name | ) |
|
Creates if unavailable, or retrieves if available, a sampler.
- Parameters
-
name | The name of the sampler to use. |
- Returns
- The sampler requested, possibly freshly created. The manager owns the memory, external code should never delete it. See erase().
◆ get()
Sampler* nkGraphics::SamplerManager::get |
( |
const std::string_view & |
name | ) |
|
Retrieves an existing sampler.
- Parameters
-
name | The name of the sampler to retrieve. |
- Returns
- The sampler requested if available, nullptr else.
◆ getByIndex()
Sampler* nkGraphics::SamplerManager::getByIndex |
( |
unsigned int |
id | ) |
|
Retrieves a sampler by index. Note that an index can return a different sampler if the internal memory is modified. Mainly used for looping over all available samplers in one go.
- Parameters
-
- Returns
- The linked sampler if available, nullptr else.
◆ rename()
void nkGraphics::SamplerManager::rename |
( |
const std::string_view & |
oldName, |
|
|
const std::string_view & |
newName |
|
) |
| |
Renames a sampler, changing both its name and way of addressing it in the manager.
- Parameters
-
oldName | The name of the sampler to move. |
newName | The new name to assign to the sampler. |
◆ erase()
void nkGraphics::SamplerManager::erase |
( |
const std::string_view & |
name | ) |
|
Erases a sampler and frees its memory.
- Parameters
-
name | The name of the sampler to erase. |
The documentation for this class was generated from the following file: